import React from 'react'
import {
    useParams,
    useLocation,
    useNavigate
} from "react-router-dom"
function withRouter(Com) {
    return (props)=>{
        const param = useParams();
        const location = useLocation();
        const navigate = useNavigate();
       
       return <Com {...props} router={{param,location,navigate}}></Com> 
}
}

export default withRouter